<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\admin\model;

use app\admin\model\RouteModel;
use think\Model;
use think\Db;

class SysCityModel extends Model
{
    function getCount($condition){

        $count = $this->where($condition)
            ->count();
        return $count;
    }
    function getlist($field,$where,$order){
        $list = $this->field($field)->where($where)->order($order)->select();
        return $list;
    }

    /**
     * 获取一定条件下的列表
     * @param unknown $condition
     * @param unknown $field
     */
    public function getModelQuery($condition, $field, $order, $group='')
    {
        if(empty($group))
        {
            $list = $this->field($field)->where($condition)->order($order)->select();
        }else{
            $list = $this->field($field)->where($condition)->group($group)->order($order)->select();
        }

        return $list;
    }

}
